
# import time
#
# t_time=time.localtime()    # t_time = time.struct_time(tm_year=2018, tm_mon=1, tm_mday=19, tm_hour=13, tm_min=2, tm_sec=3, tm_wday=4, tm_yday=19, tm_isdst=0)
# time.sleep(5)
# print(time.strftime('%Y-%m-%d %H:%M:%S',t_time))   #输出 2018-01-19 13:02:03

import time
str_time="2018-01-19 13:02:03"
print(time.strptime(str_time,'%Y-%m-%d %H:%M:%S'))   # 输出 time.struct_time(tm_year=2018, tm_mon=1, tm_mday=19, tm_hour=13, tm_min=23, tm_sec=9, tm_wday=4, tm_yday=19, tm_isdst=-1)